package tokens;

import java.util.ListIterator;
import java.util.Queue;
import java.util.Stack;
import nodes.AbstractNode;
import nodes.OpenParensNode;

/**
 * Open parenthesis token
 * 
 * @author Charlie Hatcher
 * @author Roman Zhang
 */
public class OpenParansToken extends AbstractToken {
	private static final String OPEN_PARANS = "\\(";

	@Override
	public String toString() {
		return syntaxBundle.getString("open_parenthesis_label");
	}

	@Override
	public boolean matchToken(String str, ListIterator<String> it) {
		return str.matches(OPEN_PARANS);
	}

	@Override
	public void handleParser(String str, ListIterator<String> it,
			Stack<AbstractBinaryToken> opStack,
			Queue<AbstractNode> outPutQueue, Queue<AbstractNode> queue)
			throws Exception {
		outPutQueue.add(new OpenParensNode(myModel));

	}

}
